package com.world.generator;

import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * 代码生成
 *
 * @author 邓驴
 * @date 2023/5/13 15:03
 **/
@Api(tags = "代码生成")
@RestController
public class GeneratorController {

    @Value("${spring.datasource.url}")
    private String url;
    @Value("${spring.datasource.username}")
    private String username;
    @Value("${spring.datasource.password}")
    private String password;

    @GetMapping("/gen/{tableName}/{packageName}")
    public void gen(@PathVariable("tableName") String tableName, @PathVariable("packageName") String packageName) {
        FastGenerator fastGenerator = new FastGenerator();
        fastGenerator.fastGenerator(tableName, packageName, url, username, password);
    }
}

